<!--Copyright (C) Kherty.  All rights reserved.-->
<oui:GroupPanel
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        x:Class="OpenLS.Spreadsheet.UI.ViewTabContent"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:oui="http://schemas.Kherty.com/office/2007"
    xmlns:ssui="clr-namespace:OpenLS.Spreadsheet.UI"
    xmlns:ss="http://schemas.Kherty.com/office/2007/spreadsheet"
    xmlns:Internals="clr-namespace:OpenLS.Spreadsheet.UI.Internals"
        xmlns:media="clr-namespace:OpenLS.Media;assembly=OpenLS.Media"
        xmlns:Internals1="clr-namespace:OpenLS.UI.Internals;assembly=OpenLS.UI"
    xmlns:Resources="clr-namespace:OpenLS.Spreadsheet.UI.Internals.Resources">
    <!--    
    <oui:Group Header="{x:Static Internals:UIStringTable.WorkbookViews}">
        </oui:Group>
        <oui:Group Header="{x:Static Internals:UIStringTable.Preferences}">
            <StackPanel Orientation="Horizontal">
                <StackPanel Orientation="Vertical">
                    <TextBlock Text="{x:Static Internals:UIStringTable.PreviousDocuments}"></TextBlock>
                    <CheckBox Content="{x:Static Internals:UIStringTable.Open}" IsChecked="{Binding RelativeSource={RelativeSource Self},  Path=(Internals:EditionElement.Preferences).OpenPreviousDocuments}"/>
                </StackPanel>
                <StackPanel Orientation="Vertical">
                    <TextBlock Text="{x:Static Internals:UIStringTable.Layout}"></TextBlock>
                    <CheckBox Content="{x:Static Internals:UIStringTable.Tabs}" IsChecked="{Binding RelativeSource={RelativeSource Self},  Path=(Internals:EditionElement.Preferences).TabsVisible}"/>
                    <CheckBox Content="{x:Static Internals:UIStringTable.DocumentsSelector}" IsChecked="{Binding RelativeSource={RelativeSource Self}, Path=(Internals:EditionElement.Preferences).DocumentsSelectorVisible}"/>
                </StackPanel>
            </StackPanel>

        </oui:Group>
         -->
        <oui:Group Header="{x:Static Resources:UIStringTable.ShowHide}" 
                   DataContext="{Binding RelativeSource={RelativeSource Self}, Path=(ssui:SpreadsheetElement.Worksheet)}">
            <StackPanel Orientation="Horizontal" >
                <UniformGrid Rows="2" VerticalAlignment="Stretch">
                    <!--<TextBlock Text="{x:Static Internals:UIStringTable.Gridlines}"></TextBlock> -->
                    <CheckBox IsChecked="{Binding Path=View.GridLinesVisible, Mode=TwoWay}" Content="{x:Static Resources:UIStringTable.Gridlines}"></CheckBox>
                    <CheckBox IsChecked="{Binding Path=View.RulerVisible, Mode=TwoWay}" Content="{x:Static Resources:UIStringTable.Ruler}"></CheckBox>
                </UniformGrid>
                <UniformGrid Rows="2">
                   <!-- <TextBlock Text="{x:Static Internals:UIStringTable.Headings}"></TextBlock> -->
                    <CheckBox IsChecked="{Binding Path=View.FormulasVisible, Mode=TwoWay}" Content="{x:Static Resources:UIStringTable.FormulaBar}" />
                    <CheckBox IsChecked="{Binding Path=View.RowColumnHeadersVisible, Mode=TwoWay}" Content="{x:Static Resources:UIStringTable.Headings}" />
                </UniformGrid>
            </StackPanel>
        </oui:Group>
        <oui:Group Header="{x:Static Internals1:UIStringTable.Zoom}">
            <Menu>
                <Menu>
                    <MenuItem Command="{x:Static oui:ViewCommands.SetZoom}" oui:RibbonElement.ControlState="Large"/>
                </Menu>
                <Menu>
                    <MenuItem Command="{x:Static oui:ViewCommands.SetZoom100}" oui:RibbonElement.ControlState="Large"/>
                </Menu>
                <Menu>
                    <MenuItem Command="{x:Static oui:ViewCommands.ZoomToSelection}" oui:RibbonElement.ControlState="Large"/>
                </Menu>
            </Menu>
        </oui:Group>
        <oui:Group Header="{x:Static Resources:UIStringTable.Window}">
            <StackPanel Orientation="Horizontal">
                <Menu>
                    <MenuItem Header="{x:Static Resources:UIStringTable.FreezePanes}" Icon="{media:Image FreezePanes}">
                        <MenuItem Command="{x:Static ssui:WorksheetLayoutCommands.FreezePanes}" Visibility="{Binding RelativeSource={RelativeSource Self}, Path=IsEnabled, Converter={x:Static ssui:BooleanToVisibilityConverter.Instance}}"/>
                        <MenuItem Command="{x:Static ssui:WorksheetLayoutCommands.UnfreezePanes}" Visibility="{Binding RelativeSource={RelativeSource Self}, Path=IsEnabled, Converter={x:Static ssui:BooleanToVisibilityConverter.Instance}}"/>
                        <MenuItem Command="{x:Static ssui:WorksheetLayoutCommands.FreezeTopRow}"/>
                        <MenuItem Command="{x:Static ssui:WorksheetLayoutCommands.FreezeFirstColumn}"/>
                    </MenuItem>
                </Menu>
                <!--
                <Menu>
                    <ToggleButton Command="{x:Static ssui:WorksheetLayoutCommands.ToggleSplitPanes}" oui:RibbonElement.ControlState="Medium" Loaded="ToggleButton_Loaded"
                              IsChecked="{Binding RelativeSource={RelativeSource Self}, Path=(ssui:SpreadsheetElement.Worksheet).View.Pane.State, Converter={x:Static Internals:SpreadsheetConverters.PaneStateToBooleanConverter}, Mode=OneWay}"></ToggleButton>
                    <MenuItem Command="{x:Static ssui:WorksheetLayoutCommands.HideWorkbook}" oui:RibbonElement.ControlState="Medium" />
                    <MenuItem Command="{x:Static ssui:WorksheetLayoutCommands.UnhideWorkbook}" oui:RibbonElement.ControlState="Medium" />
                </Menu>
                -->
                <Menu>
                    <MenuItem Header="{x:Static Resources:UIStringTable.SwitchWindows}" Icon="{media:Image SwitchWindow}"
                              ItemsSource="{Binding RelativeSource={RelativeSource Self}, Path=(ssui:SpreadsheetElement.Documents)}">
                        <MenuItem.ItemContainerStyle>
                            <Style TargetType="{x:Type MenuItem}">
                                <Setter Property="Command" Value="{x:Static ssui:SpreadsheetCommands.SwitchWindow}"/>
                                <Setter Property="CommandParameter" Value="{Binding}"/>
                            </Style>
                        </MenuItem.ItemContainerStyle>
                        <MenuItem.ItemTemplate>
                            <DataTemplate >
                                <TextBlock Text="{Binding Document.Name}"/>
                  </DataTemplate>
                        </MenuItem.ItemTemplate>
                    </MenuItem>
                </Menu>
            </StackPanel>
        </oui:Group>
    </oui:GroupPanel>

